<html>
<body>
Reports any cases in which <code>java.util.Optional&lt;T&gt;</code>, <code>java.util.OptionalDouble</code>, <code>java.util.OptionalInt</code>,
<code>java.util.OptionalLong</code>, or <code>com.google.common.base.Optional</code> are used as types for fields or parameters.
<p><code>Optional</code> was designed to provide a limited mechanism for library method return types in which a clear way to represent "no result"
  was needed.</p>
<p>Using a field with the <code>java.util.Optional</code> type is also problematic if the class needs to be
  <code>Serializable</code>, as <code>java.util.Optional</code> is not serializable.</p>
<p>Example:</p>
<pre><code>
  class MyClass {
    Optional&lt;String&gt; name; // Optional field

    // Optional parameter
    void setName(Optional&lt;String&gt; name) {
      this.name = name;
    }
  }
</code></pre>
<!-- tooltip end -->
</body>
</html>